/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * paneltest.java
 *
 * Created on Dec 11, 2009, 12:00:18 PM
 */

package GeneralTesting;

import java.awt.Color;
import javax.swing.JPanel;

/**
 *
 * @author Heather
 */
public class paneltest extends javax.swing.JApplet {

    /** Initializes the applet paneltest */
    public void init() {
        try {
            java.awt.EventQueue.invokeAndWait(new Runnable() {
                public void run() {
                    initComponents();
                }
            });
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    /** This method is called from within the init() method to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jPanel1 = new javax.swing.JPanel();
    testP = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();

    jPanel1.setBackground(new java.awt.Color(204, 204, 255));
    jPanel1.setLayout(null);

    testP.addMouseListener(new java.awt.event.MouseAdapter() {
      public void mouseClicked(java.awt.event.MouseEvent evt) {
        testPMouseClicked(evt);
      }
    });

    jPanel2.setBackground(new java.awt.Color(255, 204, 255));

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
      jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 370, Short.MAX_VALUE)
    );
    jPanel2Layout.setVerticalGroup(
      jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 310, Short.MAX_VALUE)
    );

    javax.swing.GroupLayout testPLayout = new javax.swing.GroupLayout(testP);
    testP.setLayout(testPLayout);
    testPLayout.setHorizontalGroup(
      testPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(testPLayout.createSequentialGroup()
        .addGap(36, 36, 36)
        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(58, Short.MAX_VALUE))
    );
    testPLayout.setVerticalGroup(
      testPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(testPLayout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(44, Short.MAX_VALUE))
    );

    jPanel1.add(testP);
    testP.setBounds(0, 0, 464, 365);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 474, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 374, Short.MAX_VALUE)
    );
  }// </editor-fold>//GEN-END:initComponents

    private void testPMouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_testPMouseClicked
    {//GEN-HEADEREND:event_testPMouseClicked
      // TODO add your handling code here:
      if (!testP.getBackground().equals(Color.red))
        testP.setBackground(Color.red);
      else
        testP.setBackground(Color.green);

}//GEN-LAST:event_testPMouseClicked


  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JPanel jPanel1;
  private javax.swing.JPanel jPanel2;
  private javax.swing.JPanel testP;
  // End of variables declaration//GEN-END:variables

}
